// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CellularAutomationEngineConfigurationSection.cs" company="dimamartovoi">
//   Apache License
//   Version 2.0, January 2004
//   http://www.apache.org/licenses
// </copyright>
// <summary>
//   The cellular automation engine configuration section.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System.Configuration;

namespace ActorModel.Infrastructure.Configuration.XML
{
    /// <summary>
    ///     The cellular automation engine configuration section.
    /// </summary>
    public class CellularAutomationEngineConfigurationSection : ConfigurationSection
    {
        #region Static Fields

        /// <summary>
        ///     The section.
        /// </summary>
        private static readonly CellularAutomationEngineConfigurationSection Section =
            (CellularAutomationEngineConfigurationSection)ConfigurationManager.GetSection("engineSection");

        #endregion

        #region Public Properties

        /// <summary>
        ///     Gets the settings.
        /// </summary>
        public static CellularAutomationEngineConfigurationSection Settings
        {
            get
            {
                return Section;
            }
        }

        /// <summary>
        ///     Gets the connectors per node.
        /// </summary>
        [ConfigurationProperty("connectorsPerNode", IsRequired = true)]
        public int ConnectorsPerNode
        {
            get
            {
                return (int)this["connectorsPerNode"];
            }
        }

        /// <summary>
        ///     Gets the message data lenth.
        /// </summary>
        [ConfigurationProperty("messageDataLenth", IsRequired = false)]
        public int MessageDataLenth
        {
            get
            {
                return (int)this["messageDataLenth"];
            }
        }

        /// <summary>
        ///     Gets the nodes.
        /// </summary>
        [ConfigurationProperty("nodes", IsRequired = false)]
        public EngineNodesElementCollection Nodes
        {
            get
            {
                return (EngineNodesElementCollection)this["nodes"];
            }
        }

        /// <summary>
        ///     Gets the nodes count.
        /// </summary>
        [ConfigurationProperty("nodesCount", IsRequired = true)]
        public int NodesCount
        {
            get
            {
                return (int)this["nodesCount"];
            }
        }

        /// <summary>
        ///     Gets the status data lenth.
        /// </summary>
        [ConfigurationProperty("statusDataLenth", IsRequired = false)]
        public int StatusDataLenth
        {
            get
            {
                return (int)this["statusDataLenth"];
            }
        }

        #endregion
    }
}